#include "label2.h"
#include "ui_label2.h"

label2::label2(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::label2)
{
    ui->setupUi(this);

    QRect windowRect = this->geometry();
    ui->label->setGeometry(0, 0, windowRect.width(), windowRect.height());
    QPixmap pixmap(":/cute.png");
    ui->label->setPixmap(pixmap);
    ui->label->setScaledContents(true); // 自动拉伸
}

label2::~label2()
{
    delete ui;
}

void label2::resizeEvent(QResizeEvent *event)
{
    ui->label->setGeometry(0, 0, event->size().width(), event->size().height());
}
